﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using eSYSU.Web.Common;

namespace eSYSU.Web.Entity
{
	/// <summary>
	///News 的摘要说明
	/// </summary>
	public partial class Article : EntityBase
	{

		public override void Copy(EntityBase entity)
		{
			base.Copy(entity);
		}


		public override EntityBase Clone()
		{
			return base.Clone();
		}

		/// <summary>
		/// 将News对象格式化为XML字符串
		/// </summary>
		/// <param name="iImageSize">图片大小（0~4）</param>
		/// <returns>XML字符串</returns>
		public String ToXmlString(Int32 iImagesSize)
		{
			System.Text.StringBuilder news = new System.Text.StringBuilder();

			//news.Append("<?xml version=\"1.0\" encoding=\"utf-8\" ?> ");
			news.Append("<News>");
			news.Append("<NewsID>" + Id.ToString() + "</NewsID>");
			news.Append("<CollegeID>" + CatalogId.ToString() + "</CollegeID>");
			news.Append("<Title>" + Title + "</Title>");
			news.Append("<Author>" + Author + "</Author>");
			news.Append("<Posttime>" + Posttime.ToLocalTime() + "</Posttime>");
			news.Append("<Embodytime>" + Embodytime.ToLocalTime() + "</Embodytime>");
			news.Append("<Origin>" + Origin + "</Origin>");
			news.Append("<Brief>" + Brief + "</Brief>");
			news.Append("<Content><![CDATA[" + StringHelper.ChangeImageUrlForMobile(Body, iImagesSize) + "]]></Content>");
			news.Append("<Keyword>" + Keyword + "</Keyword>");
			news.Append("<Originalurl>" + OriginalUrl + "</Originalurl>");
			news.Append("</News>");

			return news.ToString();
		}
	}
}